{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "JW_S8Fm0TV_j"
      },
      "source": [
        "# docext\n",
        "An on-premises document information extraction tool powered by vision-language models.\n",
        "\n",
        "- This is a demo, which runs `Qwen/Qwen2.5-VL-7B-Instruct-AWQ` VLM and supports maximum 1 images at a time.\n",
        "- By default, it will create a gradio public url which you can use to open the gradio app.\n",
        "- Credentials:\n",
        "    - Username: `admin`\n",
        "    - Password: `admin`\n",
        "\n",
        "![Demo](https://raw.githubusercontent.com/NanoNets/docext/main/assets/demo.png)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "oB_kVu30Siu5",
        "outputId": "1ebd59b6-1869-481c-ca4e-60d13d2f921b"
      },
      "outputs": [],
      "source": [
        "!git clone https://github.com/NanoNets/docext\n",
        "%cd docext\n",
        "# install the repo dependencies\n",
        "!pip install -e . -q\n",
        "# run the app\n",
        "!python -m docext.app.app --max_model_len 8000 --gpu_memory_utilization 0.9 --max_num_imgs 1 --max_img_size 1024 --concurrency_limit 1"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "KL5xGHyvTGAf"
      },
      "outputs": [],
      "source": []
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "gpuType": "T4",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
